package com.shop.domain.store;

import java.util.Date;
import java.math.BigDecimal;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>StoreProductAttrValue 实体类</p>
 * <p>Table: t_store_product_attr_value - 商品属性值表</p>
 * @author generator
 * @date 2021-02-08 04:17:39
 */
@ApiModel("StoreProductAttrValue 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_store_product_attr_value")
@SQLDelete(sql = "update t_store_product_attr_value set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class StoreProductAttrValue extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 商品ID
	 */
    @ApiModelProperty("商品ID")
	@Column(name = "product_id")
    private Long productId;

    /**
	 * 商品属性索引值 (attr_value|attr_value[|....])
	 */
    @ApiModelProperty("商品属性索引值 (attr_value|attr_value[|....])")
	@Column(name = "suk")
    private String suk;

    /**
	 * 属性对应的库存
	 */
    @ApiModelProperty("属性对应的库存")
	@Column(name = "stock")
    private Integer stock;

    /**
	 * 销量
	 */
    @ApiModelProperty("销量")
	@Column(name = "sales")
    private Integer sales;

    /**
	 * 属性金额
	 */
    @ApiModelProperty("属性金额")
	@Column(name = "price")
    private BigDecimal price;

    /**
     * 原价
     */
    @ApiModelProperty("拼团价")
    @Column(name = "pink_price")
    private BigDecimal pinkPrice;

    /**
     * 原价
     */
    @ApiModelProperty("原价")
    @Column(name = "origin_price")
    private BigDecimal originPrice;

    /**
	 * 图片
	 */
    @ApiModelProperty("图片")
	@Column(name = "image")
    private String image;

    /**
	 * 唯一值
	 */
    @ApiModelProperty("唯一值")
	@Column(name = "unique")
    private String unique;

    /**
	 * 成本价
	 */
    @ApiModelProperty("成本价")
	@Column(name = "cost")
    private BigDecimal cost;

    /**
	 * 商品条码
	 */
    @ApiModelProperty("商品条码")
	@Column(name = "bar_code")
    private String barCode;

    /**
	 * 重量
	 */
    @ApiModelProperty("重量")
	@Column(name = "weight")
    private BigDecimal weight;

    /**
	 * 体积
	 */
    @ApiModelProperty("体积")
	@Column(name = "volume")
    private BigDecimal volume;

    /**
	 * 活动限购数量
	 */
    @ApiModelProperty("活动限购数量")
	@Column(name = "quota")
    private Integer quota;

    /**
	 * 活动限购数量显示
	 */
    @ApiModelProperty("活动限购数量显示")
	@Column(name = "quota_show")
    private Integer quotaShow;

    /**
     * 状态（0：未上架，1：上架）
     */
    @ApiModelProperty("状态（0：未上架，1：上架）")
    @Column(name = "is_show")
    private Integer isShow;

    /**
	 * 创建时间
	 */
    @ApiModelProperty("创建时间")
	@Column(name = "create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
	 * 修改时间
	 */
    @ApiModelProperty("修改时间")
	@Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否删除
	 */
    @ApiModelProperty("是否删除")
	@Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;
}